# Maintainer: BlackIkeEagle <ike DOT devolder AT gmail DOT com>
# Contributor: Nils Christopher Brause <nilschrbrause@googlemail.com>
pkgname=waylandpp
pkgver=1.0.0
pkgrel=2
pkgdesc='Wayland C++ bindings'
arch=('loong64' 'x86_64')
url='https://github.com/NilsBrause/waylandpp'
license=('MIT' 'GPL3')
depends=(wayland 'pugixml')
conflicts=(waylandpp-git)
makedepends=(cmake egl-wayland)
source=("https://github.com/NilsBrause/waylandpp/archive/$pkgver.zip"
         waylandpp-gcc13.patch::https://patch-diff.githubusercontent.com/raw/NilsBrause/waylandpp/pull/75.patch)
sha512sums=('9110fb147a01bc43e54f239a694d4ed42264b86d1f51f3f6afd1d0b30e893ec2b524bf7e77295fafdcbf7fcac22af01bde7168be69865e354b081698fdf5dcc6'
            '8a3429919eb6846166b77319f39ae33405a6fb0213af0eac9e21c65f588d5085c8dd1ee6976844254368ea0c50b51dfd1c9dadd186c4570e0d417cb1e622052c')

prepare() {
  cd $pkgname-$pkgver
  patch -p1 -i ../waylandpp-gcc13.patch # Add missing includes for GCC 13
}

build()
{
    cd $pkgname-$pkgver
    [[ -d build ]] && rm -rf build
    mkdir build
    cd build
    # lib64 is a symlink to lib on archlinux.
    cmake -DCMAKE_INSTALL_PREFIX="/usr" -DCMAKE_INSTALL_LIBDIR="lib" .. 
    make
}

package()
{
    cd $pkgname-$pkgver/build
    DESTDIR="$pkgdir" make install
}
